package com.dfrz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dfrz.entity.MyCollection;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author 29877
 */
@Mapper
public interface MyCollectionMapper extends BaseMapper<MyCollection> {

    List<MyCollection> selectCollection(@Param("uid") Integer uid, @Param("index") Integer index);

    List<MyCollection> selectCollection2(@Param("uid") Integer uid, @Param("index") Integer index);

    @Select("select detail_img from video_detail where video_uid=#{videoid} limit 1 ")
    String selectcollectimg(Integer videoid);

    @Select("select * from collention where video_id=#{vid} and user_id=#{uid}")
    List<MyCollection> collectionstatus(@Param("uid") Integer uid, @Param("vid") Integer vid);

    @Delete("delete from collention where video_id=#{vid} and user_id=#{uid} ")
    void deletecollection(@Param("uid") Integer uid,@Param("vid") Integer vid);

    @Insert("insert into collention(user_id,video_id,collention_time) values(#{uid},#{vid},#{time})")
    void addcollection(@Param("uid") Integer uid,@Param("vid") Integer vid,@Param("time") String time);
}
